$("#add_repair").click(function () {
    $.ajax({
        url: "repairTask/save",
        type: "post",
        data: {
            "dormId": localStorage['dormId'],
            "device": $("#deviceName").val(),
            "content": $("#repairContent").val(),
            "token": localStorage['token']
        },
        success: function (data) {
            console.log(data);
            if (data.code == 200) {
                message("上报维修成功", "请耐心等候", "success", 1500);

            } else {
                message("提交失败", data.msg, "success", 1500);
            }
        }

    })
});

$("#deviceName, #repairContent").blur(function () {
    if ($("#deviceName").parent().children(".errorMsg").text() != "" || $("#repairContent").parent().children(".errorMsg").text() != "") {
        $("#add_repair").attr("disabled", "disabled");
        $("#add_repair").addClass("button_cannot");
    } else {
        $("#add_repair").removeAttr("disabled");
        $("#add_repair").removeClass("button_cannot");
    }
});